<?php

/* DELETE VALUES FROM DATABASE */

echo "<p>Deleting...";
$name   = mysql_field_name($result, 0);
$ok     = 1;
while (list($key,$value) = each($_POST))
{
        if (substr($key,0,7)=='delete_' && $value=='Yes')
        {
                if (mysql_query("DELETE FROM $tableName WHERE " . $name . "='" . substr($key,7) . "'")) {
                        echo " record with \"" . $name . "\" equal to \"" . substr($key,7) . "\",";
                } else {
                        echo "Error: There is an error...Unable to delete data!</p>\n";
                        $ok = 0;
                }
        }
}
echo "...Done</p>\n";

?>
